package com.noah.note.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.noah.note.R;
import com.noah.note.bean.ReplyNote;
import com.noah.note.utils.ImageUtils;
import com.noah.note.utils.StrUtils;

import java.util.List;

/**
 * Created by zzh on 2018/5/16.
 */
public class MarkAdapter extends BaseQuickAdapter<ReplyNote, BaseViewHolder> {
    public MarkAdapter(int layoutResId, @Nullable List<ReplyNote> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ReplyNote item) {
        ImageUtils.load(item.getUser().getHead(), (ImageView) helper.getView(R.id.ivHead));
        helper.setText(R.id.tvTime, StrUtils.timeToDate(item.getNTime(), "MM-dd HH:mm:ss"));
        helper.setText(R.id.tvName, item.getUser().getName());
        ImageUtils.load(item.getPic(), (ImageView) helper.getView(R.id.ivPic));
        helper.setText(R.id.tvContent, item.getContent());
    }
}
